<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Edit Item</title>
    </h:head>
    <h:body>
       <h:form id="itemManage">
           <p:panel id="panel" header="New Person" style="margin-bottom:10px;">
                <p:messages id="messages"/>  
          <h:panelGrid columns="3">  
                     
            <h:outputLabel for="itemname" value="ItemName"/>    
            <p:inputText id="itemname" value="#{itemManagedBean.itemName}"/>
            
            <p:message for="itemname" />  
            
            <p:commandButton value="submit UserInformation" actionListener="#{itemManagedBean.submitItem(event)}" ajax="false" update="datatable"/>
         </h:panelGrid> 
       </p:panel>
    </h:form>
<h:form> 
    <h:dataTable id="datatable" value="#{itemManagedBean.allItems}" 
                     var="event"
                     summary="Table showing all events">
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Customer Name" />
                </f:facet>
                <h:outputText value="#{event.name}" />
            </h:column>
          
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Id" />
                </f:facet>
                <h:outputText value="#{event.id}" />
            </h:column>
        <h:column>
                <f:facet name="header">
                    <h:outputText value="Status" />
                </f:facet>
            <p:commandButton value="Delete" actionListener="#{itemManagedBean.submitItem(event)}" ajax="false">
                    <f:attribute name="ID" value="#{event.id}" />
                </p:commandButton>
            </h:column>
        </h:dataTable>
 </h:form>
    </h:body>
</html>

